package cn.jervain.nut.auth.core.token;


import lombok.Setter;

import java.time.LocalDateTime;
import java.util.List;

public class DefaultToken<T> implements Token<T> {

    @Setter
    private Integer id;
    @Setter
    private List<String> roles;
    @Setter
    private List<String> accesses;
    @Setter
    private Boolean isLock;
    @Setter
    private T detail;
    @Setter
    private LocalDateTime expiredAt;


    @Override
    public Integer getGrantedIdentity() {
        return id;
    }

    @Override
    public List<String> getGrantedRoles() {
        return roles;
    }

    @Override
    public List<String> getGrantedAccesses() {
        return accesses;
    }

    @Override
    public LocalDateTime getGrantedExpireAt() {
        return expiredAt;
    }

    @Override
    public T getGrantedDetail() {
        return detail;
    }

    @Override
    public boolean isAccountLocked() {
        return isLock;
    }
}
